package com.huazai.juc.cec.thread.august.sixteen;

import com.huazai.juc.utils.SleepUtil;
import lombok.extern.slf4j.Slf4j;

import java.sql.Time;
import java.util.concurrent.TimeUnit;

/**
 * @author Seon
 * @date 2022/8/16 1:08
 */
@Slf4j
public class InitialProblem {
    static volatile boolean run = true;
    public static void main(String[] args) throws InterruptedException {
//        new Thread(() -> {
////            synchronized (new Object()) {
//                while (run) {
////                System.out.println("停不下来");
//                    log.info("not stop");
//                }
////            }
//        }).start();


        Thread test = new Thread(() -> {
            try {
                TimeUnit.SECONDS.sleep(3);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "test");
        test.start();
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        test.interrupt();


//        run = false;



    }
}
